<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="css/animate.min.css">
  <style type="text/css">

  </style>
</head>

<body>
  <div id="app">
    <!-- 1 给要添加动画效果的标签 包裹transition 标签 -->
    <!-- animate 官网 https://daneden.github.io/animate.css/ -->
    <!-- 进入显示效果 appear  -->

    <transition name='demo' appear appear-active-class='animated swing' enter-active-class='animated swing'
      leave-active-class='animated shake'>
      <div v-if="show">hello world</div>
    </transition>
    <button @click="handleCLick">切换</button>

  </div>

  <script type="text/javascript" src="js/vue.js"></script>
  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        show: true
      },
      methods: {
        handleCLick() {
          this.show = !this.show
        }
      }
    })
  </script>
</body>

</html>